<!--features-->
<template>
  <section class="home-blog-content feature-content">
    <div class="feature-item" v-for="(item, index) in features" :key="index">
      <img :src="item.imgUrl" />
      <div class="feature-title">{{ item.title }}</div>
      <div class="feature-suttitle">{{ item.details }}</div>
    </div>
  </section>
</template>
<script setup lang="ts">
import { computed } from 'vue'
import { usePageFrontmatter } from '@vuepress/client'

const frontmatter = usePageFrontmatter()

const features = computed(() => {
  return frontmatter.value?.customFeatures
    ? frontmatter.value?.customFeatures
    : []
})
</script>
<style lang="stylus" scoped>
.feature-content {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin-top: 3em;

  .feature-item {
    text-align: center;
    padding: 16px;
    width: 240px;
    height: 234px;
    border: 1px solid rgba(122, 122, 122, 0);
    border-radius: 6px;

    &:hover {
      border: 1px solid rgba(122, 122, 122, 0.5);

      .feature-title {
        color: rgb(93, 103, 232);
      }

      .feature-suttitle {
        color: rgba(93, 103, 232, 0.8);
      }

      img{
        animation: jumping 5s ease infinite;
      }
    }

    img {
      width: 110px;
      margin: 10px auto;
    }

    .feature-title {
      font-size: 16px;
      color: #000;
      line-height: 32px;
    }

    .feature-suttitle {
      font-size: 14px;
      line-height: 24px;
      color: #565656;
    }
  }
}

@keyframes jumping {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-12px);
  }

  100% {
    transform: translateY(0px);
  }
}
</style>